package com.yanfan.energy.domain.enums;

/**
 *
 */
public enum MaintainTaskQueryTypeEnum {

    TASK_DISTRIBUTION(1, "任务分布"), MAINTE_DETAIL(2, "保养情况"), MAINTE_PERIOD(3, "保养频率");


    private Integer code;

    private String desc;

    MaintainTaskQueryTypeEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    /**
     * 根据枚举type 返回String类型
     *
     * @param type
     * @return
     */
    public static String getEnumByType(Integer type) {
        for (MaintainTaskQueryTypeEnum item : MaintainTaskQueryTypeEnum.values()) {
            if (item.getCode().equals(type)) {
                return item.getDesc();
            }
        }
        return "";
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }


}
